package com.jk.sec.dao;

import com.jk.*;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface MovieDao {
    List<TreeBean> findTreePid(Integer pid);

    CinemaBean login(String name);

    void addUser(CinemaBean user);

    Integer count(@Param("movie") MovieBean movie);

    List<MovieBean> findPicture(@Param("start")Integer start, @Param("rows")Integer rows, @Param("movie")MovieBean movie);

    void del(Integer ids);

    List<MovieTypeBean> movieType();

    void addMovie(MovieBean movie);

    MovieBean movieQuery(@Param("ids")Integer ids);

    void updateMovie(MovieBean movie);

    void addmovietypeid(@Param("arr") String[] typeids,@Param("movieId") Integer movieId);

    void delmovietype(Integer movieId);

    void addrole(@Param("list") List<ActorBean> roleList);

    void addMovierole(@Param("movie") MovieBean movie);

    List queryRole(Integer ids);

    List<TypeBean> queryType(Integer ids);

    void delmovierole(Integer movieId);

    void delRole(Integer movieId);

    List<CinemaBean> queryUser();

    List<CinemaBean> queryCity(Integer pid);

    CinemaBean cinemaQuery(Integer ids);

    void addCinema(CinemaBean cinema);
    //新增影院影片中间表
    @Insert("insert into t_movie_cinema (movieId,cinemaId,moviePrice) values (#{movie.movieId},#{cinema.cinemaId},#{movie.moviePrice})")
    void addCinemaMovie(@Param("cinema") CinemaBean cinema, @Param("movie")MovieBean movie);

    //删除影院影片中间表
    @Delete("delete from t_movie_cinema where movieId = #{movieId} and cinemaId = #{cinemaId} ")
    void delmoviecinema(@Param("ids")Integer ids, @Param("cinemaId")Integer cinemaId);
}
